<template>
  <div>
    <swiper>
      <swiper-item v-for="item in banners" :key="item.link">
        <a :href="item.link">
          <img :src="item.image" @load="imageLoad" />
        </a>
      </swiper-item>
    </swiper>
  </div>
</template>

<script>
import swiper from "components/common/swiper/Swiper.vue";
import SwiperItem from "components/common/swiper/SwiperItem.vue";
import { getHomeMultiData } from "network/home.js";
export default {
  components: {
    swiper,
    SwiperItem,
  },
  data() {
    return {
      banners: null,
      recommends: null,
    };
  },
  created() {
    getHomeMultiData().then((res) => {
      this.banners = res.data.banner.list;
      this.recommends = res.data.recommend.list;
    });
  },
  methods: {
    imageLoad() {
      this.$emit("swiperImageLoad");
    },
  },
};
</script>

<style scoped></style>
